const tbody = document.querySelector("#shop-tbody")
getData()
function getData(){
	utils.fetch('./api/shop/select.php').then(resp=>{
		if (resp.code===200){
			const{list}=resp.body
			let html=''
			list.forEach((shop,index)=>{
				html+=`
				<tr data-id="${shop.id}">
					<td>${index+1}</td>
					<td><span>${shop.name}</span><input class="inputName" type="text"></td>
					<td><span>${shop.price}</span><input class="inputPrice"  type="text" /></td>
					<td><span>${shop.num}</span><input class="inputNum" type="text" /></td>
					<td>
						<button class="btn btn-info btn-xs btn-edit">编辑</button>
						<button class="btn btn-danger btn-xs btn-del">删除</button>
						<button class="btn btn-success btn-xs btn-ok">确认</button>
						<button class="btn btn-warning btn-xs btn-cancle">取消</button>
					</td>
				`
			})
			tbody.innerHTML=html
		}
	})
}
